/**
 * Created by siqing on 2016/8/20.
 */
$(function () {
    var toTop=$('.toTop');

    function toThetop()
    {
        $('body').animate(
            {scrollTop:0},800
        )
    }
    $(window).on('scroll',function()
    {
        if(($(window).scrollTop())<($(window).height()))
        {toTop.fadeIn();}
        else
        {toTop.fadeOut();}
    });
    $(window).trigger('scroll');
    toTop.on('click',toThetop);

    window.onload=function () {
        var  S = new Swiper('#swiper-container',{
            loop: true,
            autoplay : 5000,
            width : window.innerWidth,
            // 如果需要分页器
            pagination: '.swiper-pagination',

            // 如果需要前进后退按钮
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',
        })

    };

});

